import React from 'react';
import cn from 'classnames';
import BizIcon from '@/components/BizIcon';
import styles from './index.less';
import { getFlowType as getflowtype } from './utils';

/**
 * 根据传入类型获取对应的流程图标
 * @param props
 */
const FlowIcon = props => {
    const { iconType, className, style, isAntdIcon, ...rest } = props;
    const styleColr = getflowtype(iconType);
    return (
        <BizIcon
            {...rest}
            isAntdIcon={isAntdIcon}
            type={getflowtype(iconType) && getflowtype(iconType).className}
            className={cn(className, styles.flowIcon)}
            style={{
                backgroundColor: styleColr && styleColr.color,
                ...style
            }}
        />
    );
};
export default FlowIcon;
